package crmdna.client.isha;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Named;

import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.ApiMethod;
import com.google.api.server.spi.config.ApiMethod.HttpMethod;
import com.google.appengine.api.users.User;

import crmdna.common.APIResponse;
import crmdna.common.APIResponse.Status;
import crmdna.common.Utils;
import crmdna.program.Program;
import crmdna.program.SessionProp;

@Api(name = "isha")
public class IshaProgramApi {

	@ApiMethod(path = "getOngoingSessions", httpMethod = HttpMethod.GET)
	public APIResponse getOngoingSessions(
			@Named("dateYYYYMMDD") int dateYYYYMMDD, User user) {
		try {

			List<SessionProp> sessionProps = Program.getOngoingSessions("isha",
					dateYYYYMMDD, Utils.getLoginEmail(user));
			new ArrayList<>();

			return new APIResponse(Status.SUCCESS, sessionProps);

		} catch (Exception ex) {
			return new APIResponse(ex);
		}
	}
}
